package com.example.programme;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class DetailActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detail);
        TextView text =findViewById(R.id.text);
        Intent intent = getIntent();
        String word = intent.getStringExtra("word_key");
        String cixing=intent.getStringExtra("cixing_key");
        String translate=intent.getStringExtra("translate_key");
       if(cixing.equals("译文:")){
           String str1=word+"\n"+"\n"+translate;
           text.setText(str1);
       }else {
           String str = word + "\n" +"\n"+cixing + " " + translate;
           text.setText(str);
       }

    }
}